package com.huluobo.a2111douyindemo.demo;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import android.os.Bundle;
import android.view.View;

import com.huluobo.a2111douyindemo.R;
import com.huluobo.a2111douyindemo.databinding.ActivityLoginDemoBinding;

public class LoginDemoActivity extends AppCompatActivity {

    ActivityLoginDemoBinding activityLoginDemoBinding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        activityLoginDemoBinding = DataBindingUtil.setContentView(this, R.layout.activity_login_demo);


        activityLoginDemoBinding.login.setOnClickListener(v -> {
            String username = activityLoginDemoBinding.username.getText().toString();
            String password = activityLoginDemoBinding.password.getText().toString();
            UserBean userBean = new UserBean(username, password);
            activityLoginDemoBinding.setUser(userBean);
        });
    }
}